﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt
{
	// Token: 0x020000A8 RID: 168
	public class TDropTableSqlStatement : TCustomSqlStatement
	{
		// Token: 0x06000536 RID: 1334 RVA: 0x002FCBD9 File Offset: 0x002FADD9
		public TDropTableSqlStatement(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstdroptable;
		}

		// Token: 0x06000537 RID: 1335 RVA: 0x002FCBEA File Offset: 0x002FADEA
		internal override void buildsql()
		{
		}

		// Token: 0x06000538 RID: 1336 RVA: 0x002FCBEC File Offset: 0x002FADEC
		internal override void clear()
		{
		}

		// Token: 0x06000539 RID: 1337 RVA: 0x002FCBEE File Offset: 0x002FADEE
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x0600053A RID: 1338 RVA: 0x002FCBF5 File Offset: 0x002FADF5
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x170000D0 RID: 208
		// (get) Token: 0x0600053C RID: 1340 RVA: 0x002FCC00 File Offset: 0x002FAE00
		// (set) Token: 0x0600053B RID: 1339 RVA: 0x002FCBF7 File Offset: 0x002FADF7
		public virtual bool Cascade
		{
			get
			{
				return this.cascade;
			}
			set
			{
				this.cascade = value;
			}
		}

		// Token: 0x170000D1 RID: 209
		// (get) Token: 0x0600053E RID: 1342 RVA: 0x002FCC11 File Offset: 0x002FAE11
		// (set) Token: 0x0600053D RID: 1341 RVA: 0x002FCC08 File Offset: 0x002FAE08
		public virtual bool Restrict
		{
			get
			{
				return this.restrict;
			}
			set
			{
				this.restrict = value;
			}
		}

		// Token: 0x170000D2 RID: 210
		// (get) Token: 0x06000540 RID: 1344 RVA: 0x002FCC22 File Offset: 0x002FAE22
		// (set) Token: 0x0600053F RID: 1343 RVA: 0x002FCC19 File Offset: 0x002FAE19
		public virtual bool IfExists
		{
			get
			{
				return this.ifExists;
			}
			set
			{
				this.ifExists = value;
			}
		}

		// Token: 0x06000541 RID: 1345 RVA: 0x002FCC2C File Offset: 0x002FAE2C
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TDropTableSqlNode tdropTableSqlNode = (TDropTableSqlNode)this.rootNode;
			base.doParseStatement(psql);
			this.tableNameList = tdropTableSqlNode.TableNameList;
			this.ifExists = tdropTableSqlNode.IfExists;
			this.restrict = tdropTableSqlNode.Restrict;
			this.cascade = tdropTableSqlNode.Cascade;
			if (this.tableNameList != null)
			{
				this.tableName = this.tableNameList.getObjectName(0);
				for (int i = 0; i < this.tableNameList.size(); i++)
				{
					TTable ttable = this.analyzeTablename(this.tableNameList.getObjectName(i));
					ttable.EffectType = ETableEffectType.tetDrop;
					if (i == 0)
					{
						this.TargetTable = ttable;
					}
				}
			}
			else
			{
				this.tableName = tdropTableSqlNode.TableName;
				TTable ttable = this.analyzeTablename(this.tableName);
				ttable.EffectType = ETableEffectType.tetDrop;
				this.TargetTable = ttable;
			}
			return 0;
		}

		// Token: 0x170000D3 RID: 211
		// (get) Token: 0x06000542 RID: 1346 RVA: 0x002FCD05 File Offset: 0x002FAF05
		// (set) Token: 0x06000543 RID: 1347 RVA: 0x002FCD0D File Offset: 0x002FAF0D
		public virtual TObjectName TableName
		{
			get
			{
				return this.tableName;
			}
			set
			{
				this.tableName = value;
			}
		}

		// Token: 0x170000D4 RID: 212
		// (get) Token: 0x06000544 RID: 1348 RVA: 0x002FCD16 File Offset: 0x002FAF16
		// (set) Token: 0x06000545 RID: 1349 RVA: 0x002FCD1E File Offset: 0x002FAF1E
		public virtual TObjectNameList TableNameList
		{
			get
			{
				return this.tableNameList;
			}
			set
			{
				this.tableNameList = value;
			}
		}

		// Token: 0x06000546 RID: 1350 RVA: 0x002FCD27 File Offset: 0x002FAF27
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000547 RID: 1351 RVA: 0x002FCD37 File Offset: 0x002FAF37
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x04001139 RID: 4409
		private bool cascade;

		// Token: 0x0400113A RID: 4410
		private bool restrict;

		// Token: 0x0400113B RID: 4411
		private bool ifExists;

		// Token: 0x0400113C RID: 4412
		private TObjectName tableName;

		// Token: 0x0400113D RID: 4413
		private TObjectNameList tableNameList;
	}
}
